fname = input("请输入文本内容：")
f = open("D:\\hello.txt" ,"w")
f.write(fname)
f.close()
